package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.IAgencyCertificationService;
import com.jzo2o.customer.service.IServeProviderService;
import com.jzo2o.mvc.model.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author 86188
 */

@RestController("agencyrServeProviderController")
@RequestMapping("/agency/agency-certification-audit")
@Api(tags = "机构 - 机构认证和审核相关接口")
public class AgencyCertificationAndAuditrController {

    @Resource
    private IServeProviderService serveProviderService;
    @Resource
    private IAgencyCertificationService  agencyCertificationService;

    @PostMapping
    @ApiOperation("提交认证申请")
    public Result<Void> agencyCertificationAuditAddReq(@RequestBody AgencyCertificationAuditAddReqDTO agencyCertificationAuditAddReqDTO) {
        agencyCertificationService.agencyCertificationAuditAdd(agencyCertificationAuditAddReqDTO);
        return Result.ok();
    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public Map<String, String> checkRejectReason() {
        Map<String, String> rejectReason = agencyCertificationService.checkRejectReason();
        return rejectReason;
    }
}
